package com.sihai.ehr.service;

import com.sihai.core.Limit;
import com.sihai.core.LimitedList;
import com.sihai.core.Sorter;
import com.sihai.ehr.model.biz.LeaveOfficeApply;
import com.sihai.ehr.model.biz.LeaveOfficeApplyAuditing;
import com.sihai.ehr.model.biz.LeaveOfficeApplyHrAuditInfo;
import com.sihai.ehr.model.sys.AuditStatus;
import com.sihai.ehr.web.pojo.SearchFormPojo;

import java.util.Date;
import java.util.List;

/**
 * author: wxn
 * @since 13-4-25 19:55
 * 离职申请Service
 */
public interface LeaveOfficeApplyService {
    void save(LeaveOfficeApply apply)throws Exception;

    LeaveOfficeApply get(Long id)throws Exception;

    boolean delete(String ids)throws Exception;

    boolean delete(Long id)throws Exception;

    //得到当前登录用户的离职申请
    LimitedList<LeaveOfficeApply> findLeaveOfficeApplyByUser(Long userId)throws Exception;

    LimitedList<LeaveOfficeApply> findLeaveOfficeApplyForHrList(Long organizationId, SearchFormPojo searchFormPojo, Limit limit, Sorter sorter)throws Exception;

    LimitedList<LeaveOfficeApply> findLeaveOfficeApplyForAudit(Long organizationId, SearchFormPojo searchFormPojo, Limit limit, Sorter sorter)throws Exception;

    LimitedList<LeaveOfficeApply> findLeaveOfficeApplyForList(Long organizationId, SearchFormPojo searchFormPojo, Limit limit, Sorter sorter)throws Exception;

    //保存HR审核信息
    void saveLeaveOfficeApplyHrAuditInfo(LeaveOfficeApplyHrAuditInfo info);

    List<List<LeaveOfficeApplyAuditing>> findLeaveOfficeApplyAuditing(Long applyId)throws Exception;

    void saveLeaveOfficeApplyAuditingProcess(Long applyId)throws Exception;

    List<Object[]> findForReasonChart(Long searchOrgId, Long dutyId, String edu, String sex, int year, int month)throws Exception;
    List<Object[]> findForSexChart(Long searchOrgId, Long dutyId, String edu, String reason, int year, int month)throws Exception;
    List<Object[]> findForNumberRank(Long searchOrgId, Long dutyId, String edu, String sex, String reason, Date startDate, Limit limit)throws Exception;
    List<Object[]> findForRatioRank(Long searchOrgId, Long dutyId, String edu, String sex, String reason, int year, int month)throws Exception;

    //离职，更新员工资料表状态
    void leave(LeaveOfficeApply apply)throws Exception;
}
